#include "Client.h"
#include "Slot.h"

Client::Client(Table* _table){
  table = _table;
  cardX=0;
  cardY=0;
  suit=0;
  number=0;
  dragX=0;
  dragY=0;
  player1.at(0)->setX(30);
  player1.at(0)->setY(30);
  player1.at(1)->setX(40);
  player1.at(1)->setY(30);
}


void Client::drawTable(Table* table){ 

  gameDisplay.displayCard((player1.at(0)->getX()),(player1.at(0)->getY()),1,1,10);
  //gameDisplay.displayCard(player1.at(1)->getX(),player1.at(1)->getY(),1,1,0);
  //gameDisplay.displayCard(p2_Deck_x,p2_Deck_y,2,2,1);
  //gameDisplay.displayCard(p2_Hand_x,p2_Hand_y,2,2,1);
  //gameDisplay.displayCard(p3_Deck_x,p3_Deck_y,3,3,1);
  //gameDisplay.displayCard(p3_Hand_x,p3_Hand_y,3,3,1);
  //gameDisplay.displayCard(p4_Deck_x,p4_Deck_y,4,4,1);
  //gameDisplay.displayCard(p4_Hand_x,p4_Hand_y,4,4,1);

}

void Client::updateClient(Table* table){
  // calls the game display to capture some input
  key = gameDisplay.captureInput();
  // calls the game display to capture some input
    
      // if a mouse event occurred
      if (key == -1) {
        // make a banner message
        messageString.str("");
        messageString << "A mouse event occurred x=" \
          << gameDisplay.getMouseEventX() << ", y=" \
          << gameDisplay.getMouseEventY() << ", bstate=" \
          << gameDisplay.getMouseEventButton();
        // display a banner message
        gameDisplay.bannerTop(messageString.str());
        // record the location of the mouse event
        clickX = gameDisplay.getMouseEventX();
        clickY = gameDisplay.getMouseEventY();
        // Some of the mouse click values are defined in display.h
        // check if it was a left click
        if (gameDisplay.getMouseEventButton()&LEFT_CLICK) {
      
        // check if it was a right click
        } else if (gameDisplay.getMouseEventButton()&RIGHT_CLICK) {
        }
     
    }
  drawTable(table);
  
}


